home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.00 AddTexture Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit x=arg(1) parse var x pic texturefile bordersize . MARK pic PRIMARY PROJECT_INFO pic WIDTH picwidth=result PROJECT_INFO pic HEIGHT picheight=result PROJECT_INFO pic ZOOM origzoomval=result if texturefile="" then do if exists("ie:prefs/veaddtexture.cfg") == "1" then do call open("temp","ie:prefs/veaddtexture.cfg","R") values=readln("temp") parse var values ok texturefile bordersize . call close("temp") end else do texturefile="<tileabletexturefile>" bordersize=20 end 'FORM "Add Texture" "Use|Cancel"', 'FILE,"Texturefile",'texturefile'', 'INTEGER,"Bordersize",1,1000,'bordersize',SLIDER' values=result parse var values ok texturefile bordersize . if ok = 0 then exit call open("temp","ie:prefs/veaddtexture.cfg","W") res=writeln("temp",values) call close("temp") end if exists(strip(texturefile,B,'"')) == "0" then do 'REQUEST "Please choose an existing tileable texture." "Sorry"' exit end OPEN texturefile COLOUR texture=result PROJECT_SET texture ZOOM "1:4" RESIZE texture picwidth+(bordersize*2) picheight+(bordersize*2) TILE tiled=result CLOSE texture MARK pic PRIMARY MARK tiled SECONDARY COMPOSITE bordersize bordersize MIX 100 final=result CLOSE tiled exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end